Domain ids are 16 bits.
int xc_rrobin_global_get(int xc_handle, u64 *slice);
-#define DOMID_SELF (0x7FFFFFFEU)
+#define DOMID_SELF (0x7FFEU)
typedef struct {
#define EVTCHNSTAT_closed 0 /* Chennel is not in use. */
op.u.createdomain.cpu = cpu;
if ( (err = do_dom0_op(xc_handle, &op)) == 0 )
- *pdomid = (u32)op.u.createdomain.domain;
+ *pdomid = (u16)op.u.createdomain.domain;
return err;
}
op.u.getdomaininfo.ctxt = NULL; /* no exec context info, thanks. */
if ( do_dom0_op(xc_handle, &op) < 0 )
break;
- info->domid = (u32)op.u.getdomaininfo.domain;
+ info->domid = (u16)op.u.getdomaininfo.domain;
info->cpu =
(op.u.getdomaininfo.flags>>DOMFLAGS_CPUSHIFT) & DOMFLAGS_CPUMASK;
strncpy(info->name, op.u.getdomaininfo.name, XC_DOMINFO_MAXNAME);
info->name[XC_DOMINFO_MAXNAME-1] = '\0';
- next_domid = (u32)op.u.getdomaininfo.domain + 1;
+ next_domid = (u16)op.u.getdomaininfo.domain + 1;
info++;
}
op->u.getdomaininfo.ctxt = ctxt;
rc = do_dom0_op(xc_handle, op);
- if ( ((u32)op->u.getdomaininfo.domain != domid) && rc > 0 )
+ if ( ((u16)op->u.getdomaininfo.domain != domid) && rc > 0 )
return -ESRCH;
else
return rc;
switch ( status->status = op.u.status.status )
{
case EVTCHNSTAT_interdomain:
- status->u.interdomain.dom = (u32)op.u.status.u.interdomain.dom;
+ status->u.interdomain.dom = (u16)op.u.status.u.interdomain.dom;
status->u.interdomain.port = op.u.status.u.interdomain.port;
break;
case EVTCHNSTAT_pirq:
op.u.getdomaininfo.domain = (domid_t)domid;
op.u.getdomaininfo.ctxt = ctxt;
if ( (do_dom0_op(xc_handle, &op) < 0) ||
- ((u32)op.u.getdomaininfo.domain != domid) )
+ ((u16)op.u.getdomaininfo.domain != domid) )
{
PERROR("Could not get info on domain");
goto error_out;
pgd[HYPERVISOR_VIRT_START>>L2_PAGETABLE_SHIFT]>>PAGE_SHIFT;
live_mfn_to_pfn_table =
- mfn_mapper_map_single(xc_handle, ~0UL,
+ mfn_mapper_map_single(xc_handle, 0x7FFFU,
PAGE_SIZE*1024, PROT_READ,
mfn_to_pfn_table_start_mfn );
}
op.u.getdomaininfo.domain = (domid_t)domid;
op.u.getdomaininfo.ctxt = ctxt;
if ( (do_dom0_op(xc_handle, &op) < 0) ||
- ((u32)op.u.getdomaininfo.domain != domid) )
+ ((u16)op.u.getdomaininfo.domain != domid) )
{
PERROR("Could not get info on domain");
goto error_out;
op.u.getdomaininfo.domain = (domid_t)domid;
op.u.getdomaininfo.ctxt = NULL;
if ( (do_dom0_op(xc_handle, &op) < 0) ||
- ((u32)op.u.getdomaininfo.domain != domid) )
+ ((u16)op.u.getdomaininfo.domain != domid) )
{
PERROR("Could not get info on domain");
return -1;
* This makes sure that old versions of dom0 tools will stop working in a
* well-defined way (rather than crashing the machine, for instance).
*/
-#define DOM0_INTERFACE_VERSION 0xAAAA0010
+#define DOM0_INTERFACE_VERSION 0xAAAA0011
#define MAX_DOMAIN_NAME 16
typedef struct {
/* IN variables. */
domid_t domain; /* 0 */
- u32 __pad;
+ u16 __pad0;
+ u32 __pad1;
memory_t max_pfns; /* 8 */
MEMORY_PADDING;
void *buffer; /* 16 */
MEMORY_PADDING;
u8 name[MAX_DOMAIN_NAME]; /* 8 */
u32 cpu; /* 24 */
- u32 __pad; /* 28 */
+ u32 __pad0; /* 28 */
/* IN/OUT parameters. */
/* If 0, domain is allocated. If non-zero use it unless in use. */
domid_t domain; /* 32 */
+ u16 __pad1;
/* OUT parameters. */
} PACKED dom0_createdomain_t; /* 36 bytes */
typedef struct {
/* IN variables. */
domid_t domain; /* 0 */
+ u16 __pad;
} PACKED dom0_destroydomain_t; /* 4 bytes */
#define DOM0_PAUSEDOMAIN 10
typedef struct {
/* IN parameters. */
domid_t domain; /* 0 */
+ u16 __pad;
} PACKED dom0_pausedomain_t; /* 4 bytes */
#define DOM0_UNPAUSEDOMAIN 11
typedef struct {
/* IN parameters. */
domid_t domain; /* 0 */
+ u16 __pad;
} PACKED dom0_unpausedomain_t; /* 4 bytes */
#define DOM0_GETDOMAININFO 12
typedef struct {
/* IN variables. */
domid_t domain; /* 0 */ /* NB. IN/OUT variable. */
+ u16 __pad;
/* OUT variables. */
#define DOMFLAGS_DYING (1<<0) /* Domain is scheduled to die. */
#define DOMFLAGS_CRASHED (1<<1) /* Crashed domain; frozen for postmortem. */
typedef struct {
/* IN variables. */
domid_t domain; /* 0 */
- u32 __pad; /* 4 */
+ u16 __pad0; /* 2 */
+ u32 __pad1; /* 4 */
/* IN/OUT parameters */
full_execution_context_t *ctxt; /* 8 */
MEMORY_PADDING;
#define DOM0_IOPL 14
typedef struct {
domid_t domain; /* 0 */
+ u16 __pad;
u32 iopl; /* 4 */
} PACKED dom0_iopl_t; /* 8 bytes */
typedef struct {
/* IN variables. */
domid_t domain; /* 0 */
- u8 opcode; /* 4 */
- u8 __pad0, __pad1, __pad2;
- u32 in1; /* 8 */
- u32 in2; /* 12 */
- u32 in3; /* 16 */
- u32 in4; /* 20 */
+ u8 opcode; /* 2 */
+ u8 __pad;
+ u32 in1; /* 4 */
+ u32 in2; /* 8 */
+ u32 in3; /* 12 */
+ u32 in4; /* 16 */
/* OUT variables. */
- u32 status; /* 24 */
- u32 out1; /* 28 */
- u32 out2; /* 32 */
-} PACKED dom0_debug_t; /* 36 bytes */
+ u32 status; /* 20 */
+ u32 out1; /* 24 */
+ u32 out2; /* 28 */
+} PACKED dom0_debug_t; /* 32 bytes */
/*
* Set clock such that it would read <secs,usecs> after 00:00:00 UTC,
memory_t pfn; /* 0: Machine page frame number to query. */
MEMORY_PADDING;
domid_t domain; /* 8: To which domain does the frame belong? */
+ u16 __pad;
/* OUT variables. */
/* Is the page PINNED to a type? */
u32 type; /* 12: see above type defs */
typedef struct {
/* IN variables. */
domid_t domain; /* 0 */
+ u16 __pad;
s32 cpu; /* 4: -1 implies unpin */
} PACKED dom0_pincpudomain_t; /* 8 bytes */
typedef struct {
/* IN variables. */
domid_t domain; /* 0 */
+ u16 __pad;
u32 bus; /* 4 */
u32 dev; /* 8 */
u32 func; /* 12 */
typedef struct {
/* IN variables. */
domid_t domain; /* 0 */
+ u16 __pad;
u32 op; /* 4 */
unsigned long *dirty_bitmap; /* 8: pointer to locked buffer */
MEMORY_PADDING;
typedef struct {
/* IN variables. */
domid_t domain; /* 0 */
+ u16 __pad;
u8 name[MAX_DOMAIN_NAME]; /* 4 */
} PACKED dom0_setdomainname_t; /* 20 bytes */
typedef struct {
/* IN variables. */
domid_t domain; /* 0 */
- u32 __pad;
+ u16 __pad0;
+ u32 __pad1;
memory_t initial_memkb; /* 8 */
MEMORY_PADDING;
} PACKED dom0_setdomaininitialmem_t; /* 16 bytes */
typedef struct {
/* IN variables. */
domid_t domain; /* 0 */
- u32 __pad;
+ u16 __pad0;
+ u32 __pad1;
memory_t max_memkb; /* 8 */
MEMORY_PADDING;
} PACKED dom0_setdomainmaxmem_t; /* 16 bytes */
typedef struct {
/* IN variables. */
domid_t domain; /* 0 */
- u32 __pad;
+ u16 __pad0;
+ u32 __pad1;
memory_t num; /* 8 */
MEMORY_PADDING;
/* IN/OUT variables. */
#define EVTCHNOP_bind_interdomain 0
typedef struct {
/* IN parameters. */
- domid_t dom1, dom2; /* 0, 4 */
+ domid_t dom1, dom2; /* 0, 2 */
/* OUT parameters. */
- u32 port1, port2; /* 8, 12 */
-} PACKED evtchn_bind_interdomain_t; /* 16 bytes */
+ u32 port1, port2; /* 4, 8 */
+} PACKED evtchn_bind_interdomain_t; /* 12 bytes */
/*
* EVTCHNOP_bind_virq: Bind a local event channel to IRQ <irq>.
typedef struct {
/* IN parameters. */
domid_t dom; /* 0 */
+ u16 __pad;
u32 port; /* 4 */
/* No OUT parameters. */
} PACKED evtchn_close_t; /* 8 bytes */
typedef struct {
/* IN parameters */
domid_t dom; /* 0 */
+ u16 __pad;
u32 port; /* 4 */
/* OUT parameters */
#define EVTCHNSTAT_closed 0 /* Chennel is not in use. */
union { /* 12 */
struct {
domid_t dom; /* 12 */
+ u16 __pad;
u32 port; /* 16 */
} PACKED interdomain; /* EVTCHNSTAT_interdomain */
u32 pirq; /* EVTCHNSTAT_pirq */ /* 12 */
#ifndef __ASSEMBLY__
-typedef u32 domid_t;
+typedef u16 domid_t;
/* DOMID_SELF is used in certain contexts to refer to oneself. */
-#define DOMID_SELF (0x7FFFFFFEU)
+#define DOMID_SELF (0x7FFEU)
/*
* Send an array of these to HYPERVISOR_mmu_update().
typedef struct {
/* IN */
domid_t domid; /* 0: Domain attached to new interface. */
+ u16 __pad;
u32 blkif_handle; /* 4: Domain-specific interface handle. */
/* OUT */
u32 status; /* 8 */
typedef struct {
/* IN */
domid_t domid; /* 0: Identify interface to be destroyed. */
+ u16 __pad;
u32 blkif_handle; /* 4: ...ditto... */
/* OUT */
u32 status; /* 8 */
typedef struct {
/* IN */
domid_t domid; /* 0: Domain attached to new interface. */
+ u16 __pad;
u32 blkif_handle; /* 4: Domain-specific interface handle. */
memory_t shmem_frame; /* 8: Page cont. shared comms window. */
MEMORY_PADDING;
typedef struct {
/* IN */
domid_t domid; /* 0: Domain attached to new interface. */
+ u16 __pad;
u32 blkif_handle; /* 4: Domain-specific interface handle. */
/* OUT */
u32 status; /* 8 */
typedef struct {
/* IN */
domid_t domid; /* 0: Identify blkdev interface. */
+ u16 __pad;
u32 blkif_handle; /* 4: ...ditto... */
blkif_vdev_t vdevice; /* 8: Interface-specific id for this VBD. */
u16 readonly; /* 10: Non-zero -> VBD isn't writeable. */
typedef struct {
/* IN */
domid_t domid; /* 0: Identify blkdev interface. */
+ u16 __pad0; /* 2 */
u32 blkif_handle; /* 4: ...ditto... */
blkif_vdev_t vdevice; /* 8: Interface-specific id of the VBD. */
- u16 __pad; /* 10 */
+ u16 __pad1; /* 10 */
/* OUT */
u32 status; /* 12 */
} PACKED blkif_be_vbd_destroy_t; /* 16 bytes */
typedef struct {
/* IN */
domid_t domid; /* 0: Identify blkdev interface. */
+ u16 __pad0; /* 2 */
u32 blkif_handle; /* 4: ...ditto... */
blkif_extent_t extent; /* 8: Physical extent to append to VBD. */
blkif_vdev_t vdevice; /* 28: Interface-specific id of the VBD. */
- u16 __pad; /* 30 */
+ u16 __pad1; /* 30 */
/* OUT */
u32 status; /* 32 */
} PACKED blkif_be_vbd_grow_t; /* 36 bytes */
typedef struct {
/* IN */
domid_t domid; /* 0: Identify blkdev interface. */
+ u16 __pad0; /* 2 */
u32 blkif_handle; /* 4: ...ditto... */
blkif_vdev_t vdevice; /* 8: Interface-specific id of the VBD. */
- u16 __pad; /* 10 */
+ u16 __pad1; /* 10 */
/* OUT */
u32 status; /* 12 */
} PACKED blkif_be_vbd_shrink_t; /* 16 bytes */
typedef struct {
/* IN */
domid_t domid; /* 0: Domain attached to new interface. */
+ u16 __pad0; /* 2 */
u32 netif_handle; /* 4: Domain-specific interface handle. */
u8 mac[6]; /* 8 */
- u16 __pad; /* 14 */
+ u16 __pad1; /* 14 */
/* OUT */
u32 status; /* 16 */
} PACKED netif_be_create_t; /* 20 bytes */
typedef struct {
/* IN */
domid_t domid; /* 0: Identify interface to be destroyed. */
+ u16 __pad;
u32 netif_handle; /* 4: ...ditto... */
/* OUT */
u32 status; /* 8 */
typedef struct {
/* IN */
domid_t domid; /* 0: Domain attached to new interface. */
+ u16 __pad0; /* 2 */
u32 netif_handle; /* 4: Domain-specific interface handle. */
memory_t tx_shmem_frame; /* 8: Page cont. tx shared comms window. */
MEMORY_PADDING;
memory_t rx_shmem_frame; /* 16: Page cont. rx shared comms window. */
MEMORY_PADDING;
u16 evtchn; /* 24: Event channel for notifications. */
- u16 __pad; /* 26 */
+ u16 __pad1; /* 26 */
/* OUT */
u32 status; /* 28 */
} PACKED netif_be_connect_t; /* 32 bytes */
typedef struct {
/* IN */
domid_t domid; /* 0: Domain attached to new interface. */
+ u16 __pad;
u32 netif_handle; /* 4: Domain-specific interface handle. */
/* OUT */
u32 status; /* 8 */
u32 sched_id; /* 0 */
u32 direction; /* 4 */
domid_t domain; /* 8 */
- u32 __pad;
+ u16 __pad0;
+ u32 __pad1;
union { /* 16 */
struct bvt_adjdom
{
extern struct domain idle0_task;
extern struct domain *idle_task[NR_CPUS];
-#define IDLE_DOMAIN_ID (0x7FFFFFFFU)
+#define IDLE_DOMAIN_ID (0x7FFFU)
#define is_idle_task(_p) (test_bit(DF_IDLETASK, &(_p)->flags))
void free_domain_struct(struct domain *d);